﻿package com.wandian.view.components.ui
{
	import com.wandian.ApplicationFacade;
	import com.wandian.controller.CLZNoticeName;
	import com.wandian.data.GameData;
	import com.wandian.model.AccountProxy;
	import com.wandian.model.UserInfoProxy;
	import com.wandian.model.vo.FaceVo;
	import com.wandian.model.vo.FriendVo;
	import com.wandian.model.vo.HonorVo;
	import com.wandian.model.vo.PlayerVo;
	import com.wandian.model.vo.PropVo;
	import com.wandian.model.vo.RoomVo;
	import com.wandian.util.CLZLlistScrollPanel;
	import com.wandian.util.CLZLoadIcon;
	import com.wandian.util.CLZTabBar;
	import com.wandian.util.CLZTiming;
	import com.wandian.util.CLZZoom;
	import com.wandian.util.GlowFilterManage;
	import com.wandian.util.TextControl;
	import com.wandian.util.ToolTip;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.MouseEvent;
	import flash.events.TextEvent;

    public class HonorInfoMc extends EventDispatcher
    {
        private var _mcInfo:MovieClip;
        private var _honorVo:HonorVo;
        private const UP:int = 1;
        private const OVER:int = 2;
        private const DOWN:int = 3;
        private var _arrInfo:Array;
        private var _filter:GlowFilterManage;

        public function HonorInfoMc()
        {
            this._filter = GlowFilterManage.getInstance();
            return;
        }

        public function removeHonorInfo(param1:MovieClip) : void
        {
            var mc:* = param1;
            mc.removeEventListener(MouseEvent.ROLL_OUT, this.outHandler);
            mc.removeEventListener(MouseEvent.ROLL_OVER, this.overHandler);
            try
            {
                ToolTip.LooseDO(mc);
            }
            catch (e:Error)
            {
            }
            return;
        }

        public function setHonorInfo(param1:MovieClip, param2:HonorVo) : void
        {
            var _loc_3:String = null;
            this._mcInfo = param1;
            this._honorVo = param2;
            this._mcInfo.gotoAndStop(this.UP);
            this._mcInfo.mouseChildren = false;
            this._mcInfo.addEventListener(MouseEvent.ROLL_OUT, this.outHandler);
            this._mcInfo.addEventListener(MouseEvent.ROLL_OVER, this.overHandler);
            this._mcInfo["nameTxt"].text = this._honorVo.name;
            if (param2.isGet)
            {
                this._mcInfo.filters = [];
            }
            else
            {
                this._mcInfo.filters = this._filter.getGrayscale();
                this._mcInfo.alpha = 0.4;
            }
            CLZLoadIcon.addIcon(this._mcInfo, this._honorVo.url, 85, 85, 7, 7.5, "InitHonorIcon", false);
            ToolTip.stage = Texas.I._mcTipView.stage;
            if (this._honorVo.isGet)
            {
                _loc_3 = GameData.replaceStrValue(GameData.tip["HONOR_CONDITION"], "CONTENT", this._honorVo.des) + "\n" + GameData.replaceStrValue(GameData.tip["HONOR_REWARD"], "NUM", this._honorVo.award) + "\n" + GameData.replaceStrValue(GameData.tip["HONOR_GET_TIME"], "TIME", this._honorVo.time);
            }
            else
            {
                _loc_3 = GameData.replaceStrValue(GameData.tip["HONOR_CONDITION"], "CONTENT", this._honorVo.des) + "\n" + GameData.replaceStrValue(GameData.tip["HONOR_REWARD"], "NUM", this._honorVo.award);
            }
            ToolTip.setDOInfo(this._mcInfo, _loc_3);
            return;
        }

        private function outHandler(event:MouseEvent = null) : void
        {
            this._mcInfo.gotoAndStop(this.UP);
            CLZTiming.setTimingTip(0, ToolTip.hideToolTip);
            return;
        }

        private function overHandler(event:MouseEvent) : void
        {
            this._mcInfo.gotoAndStop(this.OVER);
            CLZTiming.setTimingTip(500, ToolTip.showToolTip);
            return;
        }

    }
}
